#ifndef DECORATIONS_H
#define DECORATIONS_H

#include "consts.h"
#include "cash.h"

class DECORATIONS : public QObject, public QGraphicsItemGroup
{
    Q_OBJECT
private:
    DECORATIONS *cover;

    QTimeLine *tl_decorations;
    QVector<QPixmap> *vect_pix;

    QRectF rect;
    QRectF scene_rect;
    DECORATIONS_TYPE type;
    QString mission;

    //для создания многослойности
    int factor;
    int factor_speed;

    bool is_cover;
    int count;

    int basic_anim_speed;
    int basic_move_speed;

    MOVE_DIRECTION last_move;

    CASH *cash;

public:
    DECORATIONS(QRectF rect, DECORATIONS_TYPE type, QString mission, int count, int factor, bool is_cover,CASH *cash);
    QRectF boundingRect() const;

    void init();
    void Generate();
    void Generate_Clowds();
    void load_Origin();
    void set_time_line(QTimeLine *timeline);

    void set_cover(DECORATIONS *tile);
    void set_basic_anim_speed(int value);

    QPainterPath shape() const;

    ~DECORATIONS();

public slots:
    void slot_anim_forward();

    void move(MOVE_DIRECTION direction);
    void move_finish();
};

#endif // DECORATIONS_H
